<?php

class Application_Form_Assigneaxeactivitemodel extends Zend_Form
{

    public function init()
    {
        /* Form Elements & Other Definitions Here ... */
    	
    	$this->setName("FormulaireAssignaxeactivite");
    	
    	$id = new Zend_Form_Element_Hidden('idPILOT_AXEACTIVITE');
    	$id->setLabel('');
    	
    	$mapper= new Application_Model_Mapper_PilotModelactivite();
    	$select=$mapper->fetchAllToArray();
    	
    	
    	$tmp=array();
    	$tmp['Activite']="selectionner activit�";
    	foreach ($select as $key => $value ){
    		$tmp[ $value['idPILOT_MODELACTIVITE'] ] = $value['idPILOT_MODELACTIVITE'];
    	}
    	$listModelActivite = array("multiOptions" => $tmp);
    	
    	$ModelActivite= new Zend_Form_Element_Select('idPILOT_MODELACTIVITE',  $listModelActivite);
    	$ModelActivite->setLabel('Activite')	;
    	$ModelActivite->setAttrib('onChange', "loadCombo('diplomeselector','id='+this.value+'&typedip=Domaine','option4');");
    	
    	
    	
    	$mapperaxes = new Application_Model_Mapper_PilotAxes();
    	$axes=$mapperaxes->fetchAllToArray();
    	
    	$checkboxlist=array();
    	
    	foreach($axes as $key => $value){
    		$checkboxlist[$value['idPILOT_AXES']]=$value['idPILOT_AXES'];
    	}
    	
    	$element = new Zend_Form_Element_MultiCheckbox('idPILOT_AXES', array(
    			'multiOptions' => $checkboxlist
    	));
    	$element->setLabel("");
    	
    	$submit = new Zend_Form_Element_Submit('submit');
    	$submit->setLabel("Ajouter");
    	
    	$this->addElements(array($id,$ModelActivite,$element,$submit));
    	$this->setDecorators( array( array('ViewScript', array('viewScript' => 'protypeform.phtml'))));
    	
    }
}

